//
//  UIButton+YYOUCategory.m
//  YYOUSDK
//
//  Created by apple on 2019/5/25.
//  Copyright © 2019 sdk. All rights reserved.
//

#import "UIButton+YYOUCategory.h"

@implementation UIButton (YYOUCategory)

- (void)yyou_resetImageToTitleTopWithMargin:(CGFloat)margin{
    
    
    CGSize imageSize = self.imageView.frame.size;
    CGSize titleLabelSize = self.titleLabel.frame.size;
    
    self.imageEdgeInsets = UIEdgeInsetsMake( -titleLabelSize.height - margin / 2, 0, 0, -titleLabelSize.width);
    self.titleEdgeInsets = UIEdgeInsetsMake(imageSize.height + margin / 2, -imageSize.width, 0, 0);
}

@end
